package com.other;

public class FactoryModelTest {
	public static void main(String[] args) {
		Sender sender = SenderFactory.getMailSender();
		sender.send();
	}
	
}

interface Sender{
	public void send();
}

class MailSender implements Sender{

	@Override
	public void send() {
		System.out.println("发送邮件");
	}
}
class MsgSender implements Sender{
	
	@Override
	public void send() {
		System.out.println("发送短信");
	}
}
class SenderFactory{
	public static Sender getMailSender(){
		return new MailSender();
	}
	public static Sender getMsgSender(){
		return new MsgSender();
	}
}



